var express = require('express');
var router = express.Router();

router.use("/",function (req,res,next) {
    if(!req.userInfo.isAdmin){
        res.render('404.html');
        return;
    }else {
        next();
    }
})

router.get('/',function (req,res) {
    res.render('admin/index/index',{
        userInfo:req.userInfo
    })
})

router.use('/user',require('../user/user'));//用户管理
router.use('/category',require('../category/category'));//分类管理
router.use('/content',require('../content/content'));//内容管理

module.exports = router;